package com.example.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@RestController
public class UserController {
    @GetMapping("/getUser")
    public String getUser(){
        System.out.println("查询成功");
        return "查询成功!";
    }

    @GetMapping("/flowThread")
    public String flowThread() throws InterruptedException {
        //当前线程睡5秒
        TimeUnit.SECONDS.sleep(5);
        return "正常访问";
    }
}
